/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.io.File;

/**
 * <p>Project: JavaStudy - Dir1
 * <p>Powered by jiangbo On 2023-01-03
 * 20:31:26
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Dir1 {
    public static void main(String[] args) {
        File file = new File("C:\\Users\\30444\\Desktop\\截图\\test2");
        //建立目录,file.exists() 判断对象是否存在，如果存在返回true,不存在返回false
        if(!file.exists()){
            System.out.println("目录不存在,目录已创建");
            file.mkdir();//建立一级目录
            //file.mkdirs();//递归建立多级目录
        }else {
            System.out.println("目录已存在");
        }
    }
}


